//
//  ViewController.m
//  SCM
//
//  Created by huangzhen on 2017/2/7.
//  Copyright © 2017年 huangzhen. All rights reserved.
//

#import "ViewController.h"
#import "HHomeViewController.h"
#import <ReactiveCocoa.h>
#import "UIView+Layout.h"
#import "UtilsMacro.h"
#import "UIImage+Color.h"
#import "UIButton+ImageAndTitleAlignmentCenter.h"
#import "WCustomNavigationController.h"

#import "HContactViewController.h"
#import "HSettingViewController.h"

@interface ViewController ()
@property (nonatomic, strong) UIView *customTabber;
@property (nonatomic, strong) NSArray * titles;
@property (nonatomic, strong) NSArray * images;
@property (nonatomic, strong) NSArray * selectedImages;
@property (nonatomic, strong) NSMutableArray * buttons;
@property (nonatomic, strong) HHomeViewController *homeViewController;
@property (nonatomic, strong) UITabBarController *tabBarController;
@property (nonatomic, strong) NSMutableArray *dataArray;
@property (nonatomic, strong) NSMutableArray *tabbarArray;


@end

@implementation ViewController
- (instancetype)init
{
    if (self = [super init]) {
        self.dataArray = [[NSMutableArray alloc]init];
        self.tabbarArray = [[NSMutableArray alloc]init];
    }
    return self;
}


- (void)viewDidLoad {
    [super viewDidLoad];
    self.view.backgroundColor = [UIColor whiteColor];
    self.navigationController.navigationBar.hidden = NO;
    self.navigationController.navigationBar.barTintColor = kNavBlueColor;
    [self setTab];
    
}

- (void)setTab
{
    [self.view addSubview:self.tabBarController.view];
    HHomeViewController *mainVC = [self createHomeViewController];
    mainVC.tabBarItem.title = @"功能导航";
    mainVC.tabBarItem.image = [UIImage imageNamed:@"功能导航"];
 
    HContactViewController *tabContacts = [[HContactViewController alloc] init];
    tabContacts.title = @"通讯录";
    tabContacts.tabBarItem.image = [UIImage imageNamed:@"首页-通讯录"];

    
    HSettingViewController *tabSetting = [[HSettingViewController alloc] init];
    tabSetting.title = @"设置";
    tabSetting.tabBarItem.image = [UIImage imageNamed:@"设置"];
    

    self.tabBarController.viewControllers = @[
                                              [[UINavigationController alloc]initWithRootViewController:mainVC],
                                              [[UINavigationController alloc]initWithRootViewController:tabContacts],
                                              [[UINavigationController alloc]initWithRootViewController:tabSetting],
                                              ];
    
    
    self.tabBarController.tabBar.barTintColor = [UIColor whiteColor];
    
}
- (UITabBarController *)tabBarController {
    if (!_tabBarController) {
        _tabBarController = [[UITabBarController alloc]init];
    }
    return _tabBarController;
}

- (HHomeViewController *)createHomeViewController {
    HHomeViewController *homeVC = [[HHomeViewController alloc]init];
    homeVC.title = @"首页";
    return homeVC;
}

- (void)didReceiveMemoryWarning {
    [super didReceiveMemoryWarning];
    // Dispose of any resources that can be recreated.
}


@end
